﻿@model Tau.ViewModels.PageList


<table border="1">
    <tr>
        <th></th>
        <th bgcolor="#cccccc">
            <a href="#" onclick="sortList('PageName');">Name</a>
            @if (Model.SortBy == "PageName")
            {
                if (Model.SortDescending)
                {
                    @("v")
                }
                else
                {
                    @("^")
                }
            }
        </th>
        <th>
            <a href="#" onclick="sortList('PageTitle');">Title</a>
            @if (Model.SortBy == "PageTitle")
            {
                if (Model.SortDescending)
                {
                    @("v")
                }
                else
                {
                    @("^")
                }
            }
        </th>
       
    </tr>

    @foreach (var page in Model.Pages) {
        <tr>
            <td>
                <a href="javascript:;" onclick="popupAddEdit(@page.PageId);" style="cursor:pointer">Edit</a> |
                <a href="javascript:;" onclick="deletePage(@page.PageId, '@page.PageName');" style="cursor:pointer">Delete</a>
            </td>
            <td>
                @page.PageName
            </td>
            <td>
                @page.PageTitle
            </td>
        </tr>
    }
</table>